/**
 *
 * @author Eric Hushagen
 * Gives admins the ability to destroy any block when equipped
 * with a gold sword.
 *
 */

import java.util.logging.Logger;
import net.minecraft.server.MinecraftServer;
import java.util.List;

public class ehGoldSword extends Plugin {

    static final ehGoldSwordListener listener = new ehGoldSwordListener();

    private String name = "ehGoldSword";

    protected static final Logger log = Logger.getLogger("Minecraft");

    public void enable() {
        log.info("ehGoldSword plugin enabled");
        tellMods("ehGoldSword plugin enabled");
    }

    public void disable() {
        log.info("ehGoldSword plugin disabled");
        tellMods("ehGoldSword plugin disabled");
    }

    public void initialize() {
        etc.getLoader().addListener(PluginLoader.Hook.BLOCK_CREATED, listener, this, PluginListener.Priority.MEDIUM);
    }

    public void tellMods(String message) {
        List<Player> pList = etc.getInstance().getServer().getPlayerList();
        for (Player p : pList) {
            if (p.isInGroup("mods")) {
                p.sendMessage(Colors.Rose + message);
            }
        }
    }

    
}
